<?xml version='1.0' encoding='UTF-8' ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.prime.com.tr/ui" >

    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <link type="text/css" rel="stylesheet" href="../themes/custom/theme.css"/>
        <link rel="stylesheet" type="text/css" href="../resources/css/default.css"/>
        <title>Merlion ERP</title>
    </h:head>

    <h:body>
        <center>
            <table>
                <tr>
                    <td id="top" colspan="2" width="1024px" height="100px" style="background:url('../resources/images/top.jpg') no-repeat" align="left" valign="bottom" >
                        <table width="1024px">
                            <tr>
                                <td>
                                    <img class="img-transparent" src="../resources/images/top_img_link.jpg" usemap="#Map"></img>
                                    <map name="Map" id="Map">
                                        <area shape="rect" coords="5,3,330,100" href="../index.xhtml" />
                                    </map>

                                </td>
                                <td align="right" valign="bottom" class="td-top-nav">
                                    <ui:insert name="top">
                                        <font size ="2">
                                            <h:form>
                                                <a href="../index.xhtml"> Home </a> &nbsp;&nbsp;
                                                <p:commandLink value="#{userSessionManagerBean.name}" actionListener="#{profileManagerBean.profile}" /> &nbsp;&nbsp;
                                                <a href="../messages.xhtml"> Message </a> &nbsp;&nbsp;
                                                <p:commandLink value="Logout" actionListener="#{profileManagerBean.logout}" />
                                            </h:form>
                                        </font>
                                    </ui:insert>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td id="left" width="150px" height="450px" valign ="top">

                        <h:form binding="#{defaultManagerBean.loadDefault}">

                          <p:calendar  selectListener="#{productionInfoManagerBean.handleDateSelect}" value="#{productionInfoManagerBean.date1}"  mode="inline" style="width:200px;"></p:calendar>

                         <marquee behavior="scroll" direction="left" scrollamount="2" >
                                       <p:commandLink ajax="true" update="productionScheduleDay,caltoday"   onclick="prodEvent.show();" > <font size ="1" color="blue" > 
                                        Click here to check on production schedule...</font> </p:commandLink> </marquee>

                            <p:dialog id="display" binding="#{productionInfoManagerBean.loadProductionInfo}" header="Production info."  widgetVar="prodEvent" modal="true" height="200" width="500" resizable="false"  >  

                                
                             Date: <b><h:outputText id="caltoday" value ="#{userSessionManagerBean.selectedDay}" ></h:outputText></b>
                     
           
                                 <p:dataTable id="productionScheduleDay" var="psd" 
                                           update="display"   value="#{userSessionManagerBean.productionInfoDays}"> 

                                     <p:column headerText="Line">  
                                        <h:outputText value="#{psd.productionSchedule.lineNumber}" />  
                                    </p:column> 
                                    <p:column headerText="Product">  
                                        <h:outputText value="#{psd.product.name}" />  
                                    </p:column> 
                                     <p:column headerText="Quantity">  
                                        <h:outputText value="#{psd.quantity}" />  
                                    </p:column>
                                     <p:column headerText="Reserved">  
                                        <h:outputText value="#{psd.reservedQuantity}" />  
                                    </p:column>
                                   
                                </p:dataTable>
                             <table>
                             <tr><td><p:commandButton id="prev" value="Prev." actionListener="#{productionInfoManagerBean.prev}"  update="productionScheduleDay,caltoday" ajax="true" /></td>
                                     <td width="500px" ></td>
                                 <td><p:commandButton id="next" value="Next" actionListener="#{productionInfoManagerBean.next}"  update="productionScheduleDay,caltoday" ajax="true" /></td>
                                 </tr></table>


                            </p:dialog>    
                            
                            
                            <br/>
                            <h:form binding="#{defaultManagerBean.loadDefault}">
                                <p:menu model="#{defaultManagerBean.model}" type="tiered" style="width:150px"></p:menu>
                            </h:form>

                        </h:form>
                        <ui:insert name="left">
                        </ui:insert>
                    </td>
                    <td id="content" valign="top" class="td-content" >
                        <ui:insert name="content"></ui:insert>
                    </td>
                </tr>
                <tr>
                    <td id="bottom2" colspan="2" style="background:url('../resources/images/bottom.jpg') no-repeat" align="right"  height="20px">&nbsp;</td>
                    <ui:insert name="bottom"></ui:insert>
                </tr>
                <tr>
                    <td id="bottom" colspan="2" align="right">
                        <font size="1px" weight="bold" color="#000000">Merlion Food Limited © 2011 · Best viewed: 1024px by 800px  · MerlionERP v1.1&nbsp;&nbsp;&nbsp;</font>
                    </td>
                </tr>

            </table>
        </center>

    </h:body>

</html>
